

import java.awt.Color;
import java.awt.Dimension;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import java.awt.event.MouseEvent;
import java.awt.event.MouseMotionListener;

import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.border.LineBorder;

public class OuterPanel extends JPanel {

	private Dimension size = new Dimension(300, 100);
	public OuterPanel(){
		super();
		init();
	}

	private void init() {
		this.setBorder(new LineBorder(Color.blue, 3));
		this.setBackground(Color.white);
		GridBagLayout layout = new GridBagLayout();
		this.setLayout(layout);
		GridBagConstraints gbc = new GridBagConstraints();
		
		gbc.insets = new Insets(5, 5, 5, 5);
		
		gbc.gridx = 0;
		gbc.gridy = 0;
		gbc.fill = GridBagConstraints.HORIZONTAL;
		gbc.gridwidth = 2;
		JLabel l1 = new JLabel("Do Search");
		
	//	l1.setBorder(BorderFactory.createLineBorder(Color.green, 1));
		l1.setHorizontalAlignment(JLabel.LEFT);
		this.add(l1, gbc);
		
		gbc.gridy = 1;
		gbc.gridwidth = 1;
		gbc.weightx = 6;

		JTextField tf = new JTextField("");
		tf.setColumns(30);
		tf.setBorder(BorderFactory.createLineBorder(Color.black));
		this.add(tf, gbc);
		
		gbc.fill = GridBagConstraints.NONE;
		gbc.anchor = GridBagConstraints.WEST;
		gbc.gridx = 1;
		gbc.weightx = 1;
		JButton b = new JButton("go");
		b.setContentAreaFilled(false);
		b.setFocusPainted(false);
		this.add(b, gbc);
	}

	
	
	/*
	public Dimension getPreferredSize(){
		return super.getPreferredSize().;
	}
	
	public Dimension getMinimumSize(){
		return size;
	}
	public Dimension getMaximumSize(){
		return size;
	}
	
	*/
}
